//
//  GEPushViewControllerHelper.m
//  ERP
//
//  Created by QA on 16/3/22.
//  Copyright © 2016年 ShangHai HaoLei Software Technology Co., Ltd. All rights reserved.
//

#import "GEPushViewControllerHelper.h"

@implementation GEPushViewControllerHelper

+ (void)pushViewControllerHomePageCode:(NSString*)tag navigation:(UINavigationController*)navigation
{
    NSString *aClassName = nil;
    if([tag isEqualToString:@"MAIN_OA_FCSH"]){
        aClassName = @"JCSubMViewController";//辅材审核
        
    } else if([tag isEqualToString:@"MAIN_OA_SQSP"]){
        aClassName = @"ApprovalProcessViewController";//审批
        
    } else if([tag isEqualToString:@"MAIN_OA_QYGW"]){
        aClassName = @"OAMyBriefcaseViewController";//企业公文
        
    } else if([tag isEqualToString:@"MAIN_OA_QYYP"]){
        aClassName = @"ECDHomeViewController";//企业云盘
        
    } else if([tag isEqualToString:@"MAIN_OA_TXL"]){
        aClassName = @"OAAddressBookCatalogViewController";//通讯录
        
    }
    
    //消息中心跳转
    else if([tag isEqualToString:@"SJXMYYGL_KSGN_SP"]){
        aClassName = @"OAMyApprovalViewController";//审批（我的审批）
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_WDDW"]){
        aClassName = @"OAMyBriefcaseViewController";//公文（企业公文）
        
    } else if([tag isEqualToString:@"SJXMYYGL_XXTZ_QYTZ"]){
        aClassName = @"OAMyMessageViewController";//通知（企业通知）
        
    }
    
    else if([tag isEqualToString:@"SJXMYYGL_KSGN_FQSQ"]){
        aClassName = @"OASendApplyViewController";//发起申请
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_FQGW"]){
        aClassName = @"OAUploadBriefcaseViewController";//发起公文
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_HTSH"]){
        aClassName = @"MTCContractAuditViewController";//合同审核
    }
    
    else if([tag isEqualToString:@"SJXMYYGL_KSGN_NBXD"]){
        aClassName = @"OMHomePageViewController";//手机订单
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_WBXD"]){
        aClassName = @"JCOrderExternalListController";//外部订单
        
    }
    
    /****************** 中铁四局集团定制功能 *********************/
    else if([tag isEqualToString:@"CREC_SJXMYYGL_KSGN_NBXD"]){
        aClassName = @"CRECOMHomePageViewController";//手机浇筑令
    }
    /****************** 中铁一局市政环保建安分公司定制功能 *********************/
    else if([tag isEqualToString:@"CREC_YJ_SJXMYYGL_KSGN_NBXD"]){
        aClassName = @"CRECOMHomePageYJController";//手机浇筑令
    }
    /*******************************************************/
    
    else if([tag isEqualToString:@"SJXMYYGL_KSGN_XZHT"]){
        aClassName = @"MTCCreateContractViewController";//新增合同
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_XZKH"]){
        aClassName = @"MTCCraeteClienterViewController";//新增客户
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_YHHT"]){
        aClassName = @"MTCContractHomeViewController";//营销合同
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_KDDA"]){
        aClassName = @"MTCClienterViewController";//客户档案
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_WDSQ"]){
        aClassName = @"OAMyApplyViewController";//我的申请
        
    } else if([tag isEqualToString:@"SJXMYYGL_XXTZ_XXTZ"]){
        aClassName = @"MessageCenterViewController";//消息通知
        
    } else if([tag isEqualToString:@"SJXMYYGL_XXTZ_QYTZ"]){
        aClassName = @"OAMyMessageViewController";//企业通知
        
    }
    
    if([tag isEqualToString:@"SJXMYYGL_KSGN_JRKB"]){
        aClassName = @"TPHomePageViewController";//今日看板
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_SSKC"]){
        aClassName = @"RawMaterialManageController";//实时库存
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_CLCX"]){
        aClassName = @"CarQueryHomesViewController";//车辆查询
        
    } else if([tag isEqualToString:@"SJXMYYGL_KSGN_ZNBF"]){
        aClassName = @"MaterialAcceptHomeController";//智能磅房
    }
    
    if([tag isEqualToString:@"SJXMYYGL_ZNYJ_GK_CN"]){
        aClassName = @"CapacityAnalysisController";//产能分析
        
    } else if([tag isEqualToString:@"SJXMYYGL_ZNYJ_GK_XH"]){
        aClassName = @"RawmaterialViewController";//原材消耗
        
    } else if([tag isEqualToString:@"SJXMYYGL_ZNYJ_GK_DLDL"]){
        aClassName = @"DeviceBatteryViewController";//搅拌机电量统计
        
    } else if([tag isEqualToString:@"SJXMYYGL_ZNYJ_GK_SDSC"]){
        aClassName = @"ManualProductionViewController";//手动生产计划
    }
    
    else if([tag isEqualToString:@"SJXMYYGL_MAIN_YCGL"]){
        aClassName = @"MCHomePageViewController";//原材管理
        
    } else if([tag isEqualToString:@"SJXMYYGL_MAIN_PBZZ"]){
        aClassName = @"MRHomePageViewController";//配比追踪
        
    } else if([tag isEqualToString:@"SJXMYYGL_MAIN_SSKC"]){
        aClassName = @"MCWarehouseRealtimeController";//材料库存
        
    } else if([tag isEqualToString:@"SJXMYYGL_MAIN_FLCX"]){
        //aClassName = @"PMSideStatisticsViewController";//方量查询
        aClassName = @"PMSideStatisticsHomeController";//方量查询
    }
    
    //跳转制定页面
    [self pushViewControllerClass:aClassName navigation:navigation];
}

+ (void)pushViewControllerCode:(NSString*)tag navigation:(UINavigationController*)navigation
{
    NSString *aClassName = nil;
    
    /********原材管理********/
    if([tag isEqualToString:@"SJXMYYGL_YCGL_YCJLTJ"]){
        //原材进料统计
        //aClassName = @"RawMaterialStaticViewController";
        
    } else if([tag isEqualToString:@"SJXMYYGL_YCGL_YCXHTJ"]){
        //原材消耗统计
        //aClassName = @"RawMaterialConsumptionViewController";
    }
    
    /********生产调度********/
    if([tag isEqualToString:@"SJXMYYGL_SCDD_TFLTJCX"]){
        //生产方量统计
        //aClassName = @"PMSideStatisticsViewController";
        
    } else if([tag isEqualToString:@"SJXMYYGL_SCDD_TSTZ"]){
        //砼剩退转
        //aClassName = @"ConcreteTurnbackViewController";
    }
    
    /********企业快报********/
    if([tag isEqualToString:@"SJXMYYGL_QYKB_CBYLRFX"]){
        //成本与利润分析
        //aClassName = @"DAAllStationCostProfitViewController";
        
    } else if([tag isEqualToString:@"SJXMYYGL_QYKB_YCFKYTSK"]){
        //原材付款与砼收款
        //aClassName = @"DAFundMainViewController";
        
    } else if([tag isEqualToString:@"SJXMYYGL_QYKB_YCYJEFX"]){
        //原材与金额分析
        //aClassName = @"DAAllAmountMaterialViewController";
        
    } else if([tag isEqualToString:@"SJXMYYGL_QYKB_TFLTJ"]){
        //集团砼方量统计
        //aClassName = @"DAConcreteSideViewController";
    }
    
    /********实验质检********/
    if([tag isEqualToString:@"SJXMYYGL_SYZJ_PBZZ"]){
        //配比追踪
        //aClassName = @"MRHomePageViewController";
    }
    
    //跳转制定页面
    [self pushViewControllerClass:aClassName navigation:navigation];
}

+ (void)pushViewControllerClass:(NSString*)aClassName navigation:(UINavigationController*)navigation
{
    if(!(aClassName && aClassName.length > 0))
        aClassName = @"WebViewController";
    
    Class classViewController = NSClassFromString (aClassName);
    UIViewController *viewController = [[classViewController alloc] init];
    [navigation pushViewController:viewController animated:YES];
}

@end
